package edu.drexel.cs575.taskManager.services.taskBroker;

import java.io.IOException;
import java.security.GeneralSecurityException;

import javax.jws.WebService;


@WebService
public class broker_caller {
	
	String keyPath = "";
	
	public broker_caller(String keyPath){
		this.keyPath = keyPath;
	}
	
	public String tlcreate_tasklist (String tl_name) throws IOException, GeneralSecurityException{ 
	broker_api test=new broker_api(this.keyPath);
	return test.tlcreate_tasklist(tl_name);
	}
	
	/*public TaskLists tllist_tasklist() throws IOException, GeneralSecurityException{
		broker_api test=new broker_api();
		return test.tllist_tasklist();
	}*/
	
	public void tldelete_tasklist(String tl_id) throws IOException, GeneralSecurityException{
		broker_api test=new broker_api(this.keyPath);
		test.tldelete_tasklist(tl_id);
	}
	
	public String tlget_tasklist_strname(String tl_id) throws IOException, GeneralSecurityException{
		broker_api test=new broker_api(this.keyPath);
		return test.tlget_tasklist_strname(tl_id);
	}
	
	public boolean tlupdate_tasklist_strname(String tl_id, String tl_newname) throws IOException, GeneralSecurityException{
		broker_api test=new broker_api(this.keyPath);
		return test.tlupdate_tasklist_strname(tl_id, tl_newname);
	}
	
	/*public com.google.api.services.tasks.model.Tasks treturn_task_list(String tl_id) throws IOException, GeneralSecurityException{
		broker_api test=new broker_api();
		return test.treturn_task_list(tl_id);
	}*/
	
	public String tget_task_name(String tl_id, String t_id) throws IOException, GeneralSecurityException{
		broker_api test=new broker_api(this.keyPath);
		return test.tget_task_name(tl_id, t_id);
	}
	
	public String addTask (String tl_id, String task_nm, String task_notes, int taskdue) throws IOException, GeneralSecurityException{
		broker_api test=new broker_api(this.keyPath);
		return test.tinsert_task(tl_id, task_nm, task_notes, taskdue);
	}
	
	public void tupdate_task (String tl_id, String t_id, String updatetype, String value) throws IOException, GeneralSecurityException{
		broker_api test=new broker_api(this.keyPath);
		test.tupdate_task(tl_id, t_id, updatetype, value);
	}
	
	public void tdelete_task (String tl_id, String t_id) throws IOException, GeneralSecurityException{
		broker_api test=new broker_api(this.keyPath);
		test.tdelete_task(tl_id, t_id);
	}
	
	public void tclear_task_complete (String tl_id) throws IOException, GeneralSecurityException{
		broker_api test=new broker_api(this.keyPath);
		test.tclear_task_complete(tl_id);
	}

	
}
